package com.hdu.clj.dncard.util

import android.content.Context
import com.hdu.clj.dncard.database.EquipmentDatabase
import com.hdu.clj.dncard.databaseUtil.EquipDatabaseUtil

/**
 * 1000X armor
 * 2000X helmet
 * 3000X boots
 * 4000X glove
 * 5000X weapon
 */
class EquipInit {
    private val equipList = arrayOf("10001","20001","30001","40001","50001","10002","20002","30002","40002","50002")
    /**
     * 新手装备
     */
    val armor1 = EquipAttr("10001",2,10,2,10,"新手上衣")
    val helmet1 = EquipAttr("20001",2,5,2,5,"新手头盔")
    val boots1 = EquipAttr("30001",1,3,1,5,"新手鞋子")
    val glove1 = EquipAttr("40001",1,3,1,5,"新手手套")
    val weapon1 = EquipAttr("50001",10,5,5,5,"新手武器")

    /**
     * 入门装备
     */
    val armor2 = EquipAttr("10002",10,30,10,30,"初级铠甲")
    val helmet2 = EquipAttr("20002",10,15,10,30,"初级头盔")
    val boots2 = EquipAttr("30002",10,9,10,30,"初级战靴")
    val glove2 = EquipAttr("40002",10,9,10,30,"初级手套")
    val weapon2 = EquipAttr("50002",30,15,20,15,"初级武器")

    /**
     * 进阶装备
     */
    val armor3 = EquipAttr("10003",20,50,10,50,"进阶铠甲")
    val helmet3 = EquipAttr("20003",15,20,15,30,"进阶头盔")
    val boots3 = EquipAttr("30003",15,20,15,30,"进阶战靴")
    val glove3 = EquipAttr("40003",15,20,15,30,"进阶手套")
    val weapon3 = EquipAttr("50003",50,10,30,20,"进阶武器")

    /**
     * 勇士装备
     */
    val armor4 = EquipAttr("10004",50,100,30,80,"勇士铠甲")
    val helmet4 = EquipAttr("20004",30,50,20,50,"勇士头盔")
    val boots4 = EquipAttr("30004",30,50,20,50,"勇士战靴")
    val glove4 = EquipAttr("40004",30,50,20,50,"勇士手套")
    val weapon4 = EquipAttr("50004",80,50,50,50,"勇士武器")

    /**
     * 铁甲勇士装备
     */
    val armor5 = EquipAttr("10005",80,100,70,120,"铁甲勇士铠甲")
    val helmet5 = EquipAttr("20005",70,50,60,80,"铁甲勇士头盔")
    val boots5 = EquipAttr("30005",70,50,60,80,"铁甲勇士战靴")
    val glove5 = EquipAttr("40005",70,50,60,80,"铁甲勇士手套")
    val weapon5 = EquipAttr("50005",120,50,100,60,"铁甲勇士武器")

    private val equipNameList = arrayOf(armor1,helmet1,boots1,glove1,weapon1,armor2,helmet2,boots2,glove2,weapon2,armor3,helmet3,boots3,glove3,weapon3,
        armor4,helmet4,boots4,glove4,weapon4,armor5,helmet5,boots5,glove5,weapon5)

    fun equipinit(context: Context,ver:Int){
        val dbEuuip = EquipmentDatabase(context,"Equip",ver)
        val dbe = dbEuuip.writableDatabase
       for (i in equipNameList){
           EquipDatabaseUtil().insert(context,ver,i)
       }
    }

}